package app.web.cartoon.report.size.tool;

import app.esb.common.NumberTools;
import app.esb.disk.DiskExcutor;
import app.web.spe.ResSPE;
import cn.lily.com.db.DBFactory;

public class CartoonSizeReport extends BaseSizeReport {

	@Override
	protected void afterData() {
		
		DBFactory.getActionDB().executeUpdate("delete from LEO_CAN_REPORT_SIZE");
		
		for(String date:this.dateResult){
			
			String sql = "insert into LEO_CAN_REPORT_SIZE (RES_TIME,LEO_CAN_DATE_INF,LEO_CAN_SIZE_TOTAL,LEO_CAN_SIZE_TOTAL_EXP,LEO_CAN_SIZE_SIZE,LEO_CAN_SIZE_SIZE_EXP) "
					          + "values (to_date('"+date+"','yyyy-mm-dd'),"
					          		  + "'"+date+"',"
					          		  + "'"+NumberTools.toSizeString(this.dataAllMap.get(date))+"',"+this.dataAllMap.get(date)+","
					          		  + "'"+NumberTools.toSizeString(this.dataPlusMap.get(date))+"',"+this.dataPlusMap.get(date)+")";
			
			DBFactory.getActionDB().executeUpdate(sql);
			
		}
		
		DBFactory.getActionDB().commit();
		
	}

	@Override
	protected void beforeData() {
		
		this.setDataTyp(ResSPE.DATA_TYP_CARTOON);
		
	}

}
